package com.sjlh.centurylianhua.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sjlh.centurylianhua.entity.Inventory;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository
public interface InventoryMapper extends BaseMapper<Inventory> {
    //不执行分页进行查询
    @Select("select inve.*, product.name productname," +
            "product.danWei,product.shou,product.id proId," +
            "depot.name depotname from Inventory inve,product,depot"+" ${ew.customSqlSegment} ")
    List<Inventory> inventorylist1(@Param("ew") QueryWrapper<Inventory> wrapper);

    //分页+查询
    @Select("select inve.*, product.name productname," +
            "product.danWei,product.shou,product.id proId," +
            "depot.name depotname from Inventory inve,product,depot"+" ${ew.customSqlSegment} ")
    List<Inventory> inventorylist2(Page<Inventory> page, @Param("ew") QueryWrapper<Inventory> wrapper);
}
